package j05autoclose;

import java.io.FileInputStream;

class Cat implements AutoCloseable{
    @Override
    public void close() throws Exception {
        System.out.println("cat close be called!");
    }
}

public class J1 {
    public static void main(String[] args) {
        try (
                FileInputStream fs = new FileInputStream("_0905/src/j05autoclose/1.txt");
                Cat c1 = new Cat()
        ){
            System.out.println(fs.read());
            System.out.println(fs.read());
        }catch (Exception e){

        }

        System.out.println("end");
    }
}


